<?php

namespace App\Http\Requests\Admin\GameTool;

use App\Models\Enum\MailType;
use Illuminate\Foundation\Http\FormRequest;

class RechargeCreateRequest extends FormRequest
{
    public function __construct()
    {

    }

    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        $rules = [
            'channel_id' => 'required',
            'server_id' => 'required',
            'nickname' => 'required',
            'reason' => 'required',
            'item_id' => 'required',
        ];
        return $rules;
    }

    public function messages()
    {
        return [
            'channel_id.required' => '渠道不能为空',
            'server_id.required_unless' => '服务器不能为空',
            'nickname.required' => '玩家昵称不能为空',
            'reason.required' => '发放理由不能为空',
            'item_id.required' => '充值物品不能为空',
        ];
    }

    protected function prepareForValidation()
    {

    }
}
